<?php 
	require('mysql.php');
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><link rel="stylesheet" type="text/css" href="../css/style.css"/>
<link rel="stylesheet" type="text/css" href="../css/sty.css"/>
<title>Tin Từng Giây</title>
</head>

<body>
<div id="wrapper">
  <div id="header">
     <div id="top-header" class="clearfix">
        <a href="#" id="logo" class="clearfix"><img src="../images/4468766.jpg" width="100" height="100" />
       <h3>Tin Từng Giây</h3></a>
 </div>
 <div style="float:right; width: 800px; margin-top:-70px; height:100px"><img src="../images/v2.banner3.jpg" width="800" height="100" /></div><br />
<br />
<br />

 <!-- MENU -->
 <div id="menu">
     <ul class="clearfix">
	 <li class="active"><a href="dn.php?idtl=home">Trang chủ</a></li>
	 <?php 
	 	$r= "SELECT * FROM theloai";
		$q= mysqli_query($dbc,$r);
	while($row=mysqli_fetch_array($q)){
	 ?>
         <li class="active"><a href="dn.php?idtl=<?php echo $row['IDtheloai']?>"><?php echo $row ['tenTL']?></a></li>
              
               <?php } ?>
      </ul>
<div id="search">
    <input type="text" value="Từ khóa" />
    <input type="submit" value="Tìm kiếm" />
		</div>
     </div>
</div> <br />


<div style="background-color:#3C6; border-radius:10px; height: 0.5cm"class="side_rbox_c">
<ul class="side_rbox_c doinglist">
<marquee direction="right" onmouseover="this.stop();" onmouseout="this.start();">
<li style=" margin-top:3px;color:#FFF">Trang thông tin điện tử Tin Từng Giây</li></marquee></ul></div>


<!-- Contentr -->

<div id="content" class="clearfix">
   <div id="main-content">
      <div class="block-content-feature">
      	<ul>
        	<li><?php
	  	$r="select IDtin,Tieude,Tomtat,anh1 from tintuc order by ngaydang asc limit 1";
		$q=mysqli_query($dbc,$r);
		$f=mysqli_fetch_array($q);
	  ?>
      <a  href="dn.php?idtin=<?php echo $f['IDtin'] ?>">
      <figure style="width:450;height: 400px" >
      <div style="margin-bottom: 10px"><img width="415px" style="float:left" src="<?php echo $f['anh1'] ?>"/></div>
      <div style="margin-left:5px;color:#000;width:400px;">
      <div class="tieude" style=" margin-top:10px; color:#3C6; font-size:16px;float:left;width:100%">
      	<?php echo $f['Tieude'] ?>
      </div>
      <div class="tomtat" style="margin-top:10px;font-size:14px;float:left;width:100%">
      	<?php echo $f['Tomtat'] ?></li>
        </ul>
       </div>


   <div class="block-content">
      <h3 class="block-tit">Bài viết mới nhất</h3>
         <ul>
           <li class="clearfix">
            <?php
	  	$r="select IDtin,Tieude,Tomtat,anh1 from tintuc where IDtheloai=1 order by ngaydang desc limit 9";
		$q=mysqli_query($dbc,$r);
		while($f=mysqli_fetch_array($q)){
	  ?>
      <a style="display:block;border-bottom:thin solid #0F3" href="dn.php?idtin=<?php echo $f['IDtin'] ?>">
      <figure style="width:450px;height:120px" >
      <img width="120px" height="90px" style="float:left" src="<?php echo $f['anh1'] ?>"/>
      <div style="margin-left:5px;color:#000;width:300px;float:right;">
      <div class="tieude" style=" color:#3C6;font-size:14px;float:left;width:100%">
      	<?php echo $f['Tieude'] ?>
      </div>
      <div class="tomtat" style="margin-top:10px;font-size:12px;float:left;width:100%">
      	<?php echo $f['Tomtat'] ?>
      </div>
      </div>
      </figure></a>
<?php } ?>
           </li>
                        </ul>
                    </div>
                </div>

   <!-- MỤC CHỌN -->
                <div id="sidebar-first">
                    <div class="block-sidebar-first block-tab">
                        <ul id="tab-header">
                            <li class="active"><a href="#">Tin Mới</a></li>
                            <li><a href="#">Tin Đọc nhiều</a></li>
                        </ul>
                        <ul id="tab-content">
                          <li>
                            <?php
	  	$r="select IDtin,Tieude,anh1 from tintuc order by Luotxem desc limit 4";
		$q=mysqli_query($dbc,$r);
		while($f=mysqli_fetch_array($q)){
	  ?><a style="display:block;border-bottom:thin solid #0F3" href="../trangchinh/index.php?idtin=<?php echo $f['IDtin'] ?>">
      <img width="60px" height="45px" style="float:left" src="<?php echo $f['anh1'] ?>"/>
      
      <figure style="width:190px;height:30px" >
      <div class="tieude" style="font-size:12px;width:150px; color:#000">
      	<?php echo $f['Tieude'] ?>
      </div>
      </figure><br />
</a>
<?php } ?>
                          </li>
                        </ul>
                    </div>
                    <div class="block-sidebar-first rate-device">
                        <h3 class="tit">Tin nổi bật</h3>
                        <ul>
                            <li>
                            <?php
	  	$r="select IDtin,Tieude,Tomtat,anh1 from tintuc where IDtheloai=1 order by ngaydang asc  limit 1";
		$q=mysqli_query($dbc,$r);
		while($f=mysqli_fetch_array($q)){
	  ?><a style="display:block;border-bottom:thin solid #0F3" href="../trangchinh/index.php?idtin=<?php echo $f['IDtin'] ?>">
      <img width="60px" height="45px" style="float:left" src="<?php echo $f['anh1'] ?>"/>
      
      <figure style="width:190px;height:30px" >
      <div class="tieude" style="font-size:12px;width:140px; color:#000">
      	<?php echo $f['Tieude'] ?>
      </div>
      </figure><br />
</a>
<?php } ?>
<?php
	  	$r="select IDtin,Tieude,Tomtat,anh1 from tintuc where IDtheloai=4 order by ngaydang asc  limit 1";
		$q=mysqli_query($dbc,$r);
		while($f=mysqli_fetch_array($q)){
	  ?><a style="display:block;border-bottom:thin solid #0F3" href="../trangchinh/index.php?idtin=<?php echo $f['IDtin'] ?>">
      <img width="60px" height="45px" style="float:left" src="<?php echo $f['anh1'] ?>"/>
      
      <figure style="width:190px;height:30px" >
      <div class="tieude" style="font-size:12px;width:140px; color:#000">
      	<?php echo $f['Tieude'] ?>
      </div>
      </figure><br />
</a>
<?php } ?>
<?php
	  	$r="select IDtin,Tieude,Tomtat,anh1 from tintuc where IDtheloai=2 order by ngaydang asc  limit 1";
		$q=mysqli_query($dbc,$r);
		while($f=mysqli_fetch_array($q)){
	  ?><a style="display:block;border-bottom:thin solid #0F3" href="../trangchinh/index.php?idtin=<?php echo $f['IDtin'] ?>">
      <img width="60px" height="45px" style="float:left" src="<?php echo $f['anh1'] ?>"/>
      
      <figure style="width:190px;height:30px" >
      <div class="tieude" style="font-size:12px;width:140px; color:#000">
      	<?php echo $f['Tieude'] ?>
      </div>
      </figure><br />
</a>
<?php } ?>
<?php
	  	$r="select IDtin,Tieude,Tomtat,anh1 from tintuc where IDtheloai=3 order by ngaydang asc  limit 1";
		$q=mysqli_query($dbc,$r);
		while($f=mysqli_fetch_array($q)){
	  ?><a style="display:block;border-bottom:thin solid #0F3" href="../trangchinh/index.php?idtin=<?php echo $f['IDtin'] ?>">
      <img width="60px" height="45px" style="float:left" src="<?php echo $f['anh1'] ?>"/>
      
      <figure style="width:190px;height:30px" >
      <div class="tieude" style="font-size:12px;width:140px; color:#000">
      	<?php echo $f['Tieude'] ?>
      </div>
      </figure><br />
</a>
<?php } ?></li>
                        </ul>
                    </div>
                    <div class="block-sidebar-first rate-device">
                    <h6 style="color:#3C6" class="tit">-</h6>
                    <div><img width="200" height="auto" src="../images/adv.jpg"/></div>
                    </div>
                </div>
<!-- BÌNH LUẬN -->
                <div id="sidebar-second">
                    <div class="block-sidebar-second block-comment">
                        <h3 class="tit">Tài Khoản</h3>
                        <ul>
                          
                            <li><a href="dn.php?trang=dangnhap">Đăng Nhập</a>
                            /<a href="dn.php?trang=dangky">Đăng Ký</a>                    </li>
                            
                        </ul>
                    </div>
                    <div class="block-sidebar-second block-vote">
                    <p style="color:#3C6" class="tit">-<p>
                        <div><img width="230" height="auto" src="../images/adv.jpg"/></div>
                    </div>
                </div>

            </div>
            
            
<!-- FOOTER -->
            <div id="footer" class="clearfix">
                <p>Tin Từng Giây có bản quyền thuộc về Nhóm 3 lớp C1406IV - Aprotrain Aptech</p>
            </div>

        </div>
</body>
</html>